Method: RuboCop::Cop::Offense#<=>

Defined in:
lib/rubocop/cop/offense.rb

#<=>(other) ⇒ Integer

Returns ‘-1`, `0`, or `+1` if this offense is less than, equal to, or greater than `other`.

Returns:

  • (Integer)

    comparison result

[View source]

229
230
231
232
233
234
235
# File 'lib/rubocop/cop/offense.rb', line 229

def <=>(other)
  COMPARISON_ATTRIBUTES.each do |attribute|
    result = public_send(attribute) <=> other.public_send(attribute)
    return result unless result.zero?
  end
  0
end